Repository navigation
Conversation
544f3ee to
5fdd648
Compare
left a comment
There was a problem hiding this comment.
@kv2019i looks good, I would keep comment too.
commented
Jun 5, 2019
@plbossart I tried the exact same change yesterday but it doesnt fix the IPC timeouts. The thing that does work is clearing the RIRB status in the ipc interrupt handler unconditionally |
commented
Jun 5, 2019
I am struggling to see why that would work better. |
commented
Jun 5, 2019
|
@ranj063 wrote:
Ack, this does not fix the MSI issue. But nevertheless I think this change is still valid, even if it doesn't fix the issue. The current logic of not serving RIRB if SIS bits are zero, is simply wrong. The HDA stream IQ handler should serve events raised via CIS+SIS bits. |
commented
Jun 5, 2019
@plbossart in fact clearing the RIRB status even before checking for the invalid value in the stream interrupt handler doesnt help either. I am not sure if there is a race between the 2 interrupt handlers and the IPC interrupt handler gets called first and changes the flow. We were just discussing the possibility in our call this morning but no resolution yet |
commented
Jun 5, 2019
|
@plbossart @kv2019i this PR makes sense but given how fragile our IPC has been lately, I'd ask for some stress tests to be done before merging. |
commented
Jun 5, 2019
agree, I will not merge before I see a strong signal that this actually improves things. If there is still something else in the shadows let's root cause it. |
|
|
||
| if (!pm_runtime_active(bus->dev)) | ||
| return ret; | ||
|
|
There was a problem hiding this comment.
yep for RIRB but for stream events its' not really possible to get stream interrupts without being in pm_runtime_active, is it? Do we want to remove this completely?
There was a problem hiding this comment.
agree that we should just move it to after the RIRB status check. And also just fyi that this doesnt fix our IPC timeout issues still.
The HDA interrupt handler incorrectly returns IRQ_NONE in case the Stream Interrupt Status bits are all zeroes. This is incorrect as the controller interrupt can be raised to signal various other events such as Response Interrupt, SDI State Change among others. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
It is possible to get interrupts from the HDA controller even during suspend process. If RIRB events are not acked properly, this will block other interrupts and e.g. block the CTX_SAVE IPC that is used as part of run runtime suspend process. Remove the check for device runtime state and process irqs whenever the INTSTS and RIRBSTS registers are set. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
To avoid issue with 1st level interrupt bits (like RIRBSTS) being raised while irq handlers (AudioHDA and AudioDSP) are executing, mask the 2nd level CTRL_EN/CIS interrupt in hda-stream hard handler and handle all work in the hda-stream thread. In the irq thread, unmask CTRL_EN/CIS and handle all work as reported by 1st level bits. Clearing the bits may cause a new irq to be triggered, but this is ok as we clear the bits in the irq thread. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Co-developed-by: Libin Yang <libin.yang@intel.com> Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
fc59823 to
1848733
Compare
commented
Jun 6, 2019
|
With latest patches for masking-unmasking CIS, IPC timeouts are now gone. There is some problem on APL -- HDMI probe fails. If this general approach gathers support, I'll address that. |
commented
Jun 6, 2019
|
Kernel build fails is likely an indication that the split between SOF_HDA and nocodec is not handled correctly? ERROR: "snd_hdac_bus_update_rirb" [sound/soc/sof/intel/snd-sof-intel-hda-common.ko] undefined! |
| } | ||
|
|
||
| /* unmask 2nd level CTRL_EN (CIS) before clearing 1st level RIRBSTS */ | ||
| snd_hdac_chip_updatel(bus, INTCTL, AZX_INT_CTRL_EN, 1); |
There was a problem hiding this comment.
does this make sense to unmask before clearing the interrupts?
or is this intentional to get the new interrupts what might have been raised by the handler?
There was a problem hiding this comment.
@plbossart This is on purpose. Clearing RIRBSTS bits will cause hardware to create a new interrupt and we want to allow this to happen by unmasking the CTRL_EN first.
| if (rirb_status & RIRB_INT_RESPONSE) | ||
| snd_hdac_bus_update_rirb(bus); | ||
| snd_hdac_chip_writeb(bus, RIRBSTS, RIRB_INT_MASK); | ||
| } |
There was a problem hiding this comment.
All of this should be protected by an #ifdef SOF_HDA
commented
Jun 10, 2019
We are now going with PR1013 and testing&review is in progress for that. If all is well, this PR1011 is not needed. I'll mark this with "unclear" tag for now. |
|
|
||
| if (!pm_runtime_active(bus->dev)) | ||
| return IRQ_NONE; | ||
| return ret; |
There was a problem hiding this comment.
mmh, I'm not sure I like such changes. I think they might have some micro-optimisation effect on some platforms because "ret" is a register and some operations are easier to do with a register than a literal constant... But I would say this is a negligible optimisation ;-) Whereas "return IRQ_NONE" saves a scroll back and a check - has "ret" been changed in the meantime... So I actually tend to prefer constants in such cases.
| if (status == 0xffffffff) { | ||
| spin_unlock(&bus->reg_lock); | ||
| return IRQ_NONE; | ||
| return ret; |
| } | ||
|
|
||
| /* unmask 2nd level CTRL_EN (CIS) before clearing 1st level RIRBSTS */ | ||
| snd_hdac_chip_updatel(bus, INTCTL, AZX_INT_CTRL_EN, 1); |
There was a problem hiding this comment.
commented
Jul 2, 2019
commented
Jul 2, 2019
|
commented
Jul 17, 2019
|
@kv2019i is this still relevant or can we close this PR? |
commented
Jul 18, 2019
@plbossart Yes, it seems the current merged fix is holding up with no new findings in recent weeks, so let's close this one. |
Patchset to address problems in HDA IRQ handling.
On of many alternatives: others PR1013 and PR1015